<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../libs/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../libs/app.css" />
		<link href="../../css/main.css" rel="stylesheet" />
		<link href="../../css/assess-d.css" rel="stylesheet" />
	</head>

	<body>
		<div class="head">
			<img class="mui-action-back" src="../../images/all-left.png" alt="">
			<p>二押</p>
		</div>
		<div class="content">
			<!--列表-->
			<div class="list">

				<!--房龄-->
				<div class="mui-table-view">
					<div class="mui-table-view-cell">
						<div class="lx-le">房龄</div>
						<div class="lx-ri toast-one"><span class="bd-m lx-ri">年</span><input class="bd-ri" placeholder="单行输入" value=""></div>
					</div>
				</div>
				<!--房产证-->
				<div class="mui-table-view">
					<div class="mui-table-view-cell">
						<div class="lx-le">房产证</div>
						<div class="lx-ri toast-two"><span class="bd-m lx-ri">月</span><input class="bd-ri" placeholder="单行输入" value=""></div>
					</div>
				</div>

				<!--还款期限期-->
				<div id="xl-y" class=" mui-table-view">
					<div class="mui-table-view-cell">
						<a href="#already-pm">
							<div class="lx-le">还款期限期</div>
							<div id="payment-y" class="payment lx-ri">选择</div>
						</a>
					</div>
				</div>
				<div id="already-pm" class="payment-y mui-popover mui-popover-action mui-popover-bottom" style="background-color: #efeef4">
					<ul class="mui-table-view" style="margin: 0px;border-radius: 0px;font-size: 14px;">
						<li class="mui-table-view-cell popover-bottom">
							<a href="#">6期</span>
							</a>
						</li>
						<li class="mui-table-view-cell popover-bottom">
							<a href="#">12期</span>
							</a>
						</li>
						<li class="mui-table-view-cell popover-bottom">
							<a href="#">24期</span>
							</a>
						</li>
						<li class="mui-table-view-cell popover-bottom">
							<a href="#">36期</span>
							</a>
						</li>

					</ul>
					<ul class="mui-table-view" style="margin: 10px 0px 0px 0px;border-radius: 0px;">
						<li class="mui-table-view-cell popover-bottom-remove">
							<a href="#already-pm">取消</a>
						</li>
					</ul>
				</div>

			</div>

			<!--按钮-->
			<div class="buttons">
				<div class="add add-button">继续添加</div>
				<div class="add add-submit" id="evaluate">提交</div>
			</div>
		</div>
		<script src="../../libs/mui.min.js"></script>
		<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/url.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/assess-public.js"></script>
		<script type="text/javascript">
			$('.toast-one').on('tap', function() { mui.toast("低于30年") })
			$('.toast-two').on('tap', function() { mui.toast("超过6个月") })

			//			提交^[0-9]+(.[0-9]{2})?$
			$('#evaluate').on('tap', function() {
				//各参数数组		
				var params = new ToArr();
				var type = $('#info-lx').text();
				var type = params.getType('.type-info');

				//				var number = $('.number').val();
				var numbers = params.getStr('.number');

				var price = $('.bd-ri').val();
				var price = params.rechange('.price');

				var month = $('#payment-y').text();
				var month = new ToArr('.payment-yj', "个月").change();

				var sub = $('#payment-c').text();
				var sub = new ToArr('.payment-cs', "次").change();

				var stage = $('#infoone').text();
				var stage = params.rechange('.infoone-qx', "期");

				var baodan = /^[0-9]*$/;
				var yuan = /^[0-9]+(.[0-9]{3})?$/;
				if(!baodan.test(number)) {
					mui.toast('请检查您的保单编号...');
					return;
				} else if(!yuan.test(price)) {
					mui.toast('请检查您购买保单金额...');
					return;
				} else if(type == '' || type == null || type == '选择' || number == '' || number == null || price == '' || price == null || month == '' || month == null || month == '选择' || sub == '' || sub == null || sub == '选择' || stage == '' || stage == null || stage == '选择') {
					mui.toast('请把信息填充完整...');
					return;
				} else {
					a();
				}
				//			接口		
				function a() {
					$.ajax({
						url: ur + "rest/loanController/evaluate",
						headers: {
							"X-Token": "027CEAAF9D6F451EAA0DF1D8F694C9E3"
						},
						dataType: "json",
						data: {
							loanCode: "rsbd",
							param: "[{type:'" + type + "',number:'" + number + "',price:" + price + ",month:" + month + ",sub:" + sub + ",stage:" + stage + "}]",
						},
						type: "POST",
						success: function(data) {
						}
					});

				}
			});
		</script>
	</body>

</html>